home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / src / cmds / hppicmd / results.latency / post < prev    next >
Encoding:
Text File  |  1991-01-15  |  900 b   |  50 lines

  1. #!/sprite/cmds/perl
  2.  
  3. do 'getopts.pl';
  4. do Getopts('vm');
  5.  
  6. $currentSize = -1;
  7.  
  8. while(<>) {
  9.     if (/^[0-9]+/) {
  10.     ($size, $time, $timeouts) = split(" ");
  11.     if ($timeouts eq "timeouts") {
  12.         next;
  13.     }
  14.     if ($size != $currentSize) {
  15.         if ($currentSize != -1) {
  16.         printf("%6.2f %6.2f", $currentSize / 1024, $total / $count);
  17.         if ($opt_v) {
  18.             printf(" %f %f", $min, $max);
  19.         } 
  20.         printf("\n");
  21.         }
  22.         $count = 0;
  23.         $total = 0;
  24.     }
  25.     $currentSize = $size;
  26.     if ($opt_m) {
  27.         $value = (($size * 2) / $time) / (1024 * 1024);
  28.     } else {
  29.         $value = $time * 1000 / 2;
  30.     }
  31.     $total += $value;
  32.     if ($value < $min || $count == 0) {
  33.         $min = $value;
  34.     }
  35.     if ($value > $max || $count == 0) {
  36.         $max = $value;
  37.     }
  38.     $count++;
  39.     }
  40. }
  41. if ($currentSize != -1) {
  42.     printf("%6.2f %6.2f",$currentSize / 1024, $total / $count);
  43.     if ($opt_v) {
  44.     printf(" %f %f", $min, $max);
  45.     } 
  46.     printf("\n");
  47. }
  48.  
  49.  
  50.